﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinqToSqlSchema;
using NUnit.Framework;

namespace Test
{
	public class Example
	{
		[TestFixture]
		public class TestNorthwind
		{
			/// <summary>
			/// This isn't really a test, its just to show that it can read from a database schema! 
			/// Make sure you have Northwind and check the console output.
			/// </summary>
			[Test]
			public void CheckIfTablesAreReturned()
			{
				using (var dc = new SqlSchemaDataContext("server=.;database=northwind;trusted_connection=true"))
				{
					foreach (var t in dc.tables)
					{
						Console.WriteLine(t.name);
						foreach(var column in t.columns)
						{
							Console.WriteLine("\t" + column.name);
						}
					}
				}
			}
		}
	}
}
